package cn.tmall.servlet;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.tmall.bean.Order;
import cn.tmall.dao.OrderDAO;
import cn.tmall.dao.OrderItemDAO;
import cn.tmall.util.Page;

public class OrderServlet extends BaseBackServlet{
	
	public String list(HttpServletRequest request,HttpServletResponse response,Page page){
		List<Order> os = new OrderDAO().list(page.getStart(), page.getCount());
		new OrderItemDAO().fill(os);
		request.setAttribute("os", os);
		int total = new OrderDAO().getTotal();
		page.setTotal(total);
		request.setAttribute("page", page);
		return "admin/listOrder.jsp";
	}
}
